﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class AddAdminer : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null == Session["admin"])
        {
            Response.Write("<script>alert('请登录！');window.location.href='SysLogin.aspx';</script>");
        }
        Label1.Text = "";
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            AdminLogin lg = new AdminLogin();
            if (lg.addadminer(txtname.Text.Trim(), MD5.EncodeMD5(txtpwd.Text.Trim())).Equals("1"))
            {
                Label1.Text = "<script>alert('添加成功！');window.location.href='AddAdminer.aspx');</script>";

            }
            else
            {
                Label1.Text = "<script>alert('添加失败！');</script>";
            }
        }
    }
}
